/**
 * Copyright (c) 2010-2011 julewa.com.  
 * All rights reserved. 
 * 
 * @author Huang Benhua
 * @date 2011-7-20
 * 
**/
package com.julewa.db.checkers;

import com.julewa.db.DataState;

public class _CharChecker extends DataStateChecker{
	private int valueMin, valueMax;
	protected void _init() {
		if(checkMin)valueMin = (int)min;
		if(checkMax)valueMax = (int)max;
	};
	public DataState _check(Object obj){
		int val = (Integer)obj;
		if(checkMin&& val < valueMin){
			return DataState.TOO_SMALL;
		}
		if(checkMax&& val > valueMax){
			return DataState.TOO_BIG;
		}
//		if(checkFormat){
//			throw new TODO("check format");
//		}
		return DataState.NORMAL;
	};
}
